import {Component} from '@angular/core';
import {Route, Router} from '@angular/router';

@Component({
  selector: 'app-root',
  templateUrl: './app.component.html',
  styleUrls: ['./app.component.css']
})
export class AppComponent {
  title = 'app';

  private router: Router;

  constructor(router: Router){
    this.router = router;
  }

  toDetailPage() {
    this.router.navigate(['/product', 2]);
  }
}
